package com.msb.c04;

/**
 * @author: xw
 * @create: 2022/9/22 14:41
 * @description:分析一下这个程序的输出
 */
public class T implements Runnable {

        private int count = 10;

        @Override
        public synchronized void run() {
            count--;
            System.out.println(Thread.currentThread().getName() + " count = " + count);
        }

        public static void main(String[] args) {

            for(int i=0; i<5; i++) {
                T t = new T();
                new Thread(t, "THREAD" + i).start();
            }
        }
}
